package com.hyz.controller;

import com.hyz.pojo.ResponseResult;
import com.hyz.pojo.assetSecondment.AssetSecondmentRequest;
import com.hyz.pojo.assetSecondment.AssetSecondmentResponse;
import com.hyz.service.FinancialService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author HGD
 * @date 2022/10/6 21:20
 */
@Api("财务人员")
@RequestMapping("/financial")
@RestController
public class FinancialController {
    @Autowired
    private FinancialService service;

    @ApiOperation("财务人员获取资产调用申请")
    @ApiResponse(code = 200, message = "成功", response = ResponseResult.class)
    @PostMapping("/fnlGetAssetSecondment")
    public ResponseResult<List<AssetSecondmentResponse>> fnlGetAssetSecondment() {
        return service.fnlGetAssetSecondment();
    }

    @ApiOperation("财务人员审批资产调用申请")
    @ApiResponse(code = 200, message = "成功", response = ResponseResult.class)
    @PostMapping("/fnlUpdateAssetSecondment")
    public ResponseResult<List<AssetSecondmentResponse>> fnlUpdateAssetSecondment(@RequestBody AssetSecondmentRequest request) {
        return service.fnlUpdateAssetSecondment(request);
    }
}
